﻿using Windows.Web.Syndication;

namespace Unread.Business.Data.Syndication
{
    public static class ISyndicationTextExtensions
    {
        public static string GetText(this ISyndicationText syndicationText)
        {
            if (syndicationText == null) return null;

            return syndicationText.Text;
        }

        public static string GetText(this ISyndicationText syndicationText, string defaultText)
        {
            var text = GetText(syndicationText);
            if (string.IsNullOrWhiteSpace(text))
                return defaultText;

            return text;
        }
    }
}
